Part Number Hot Search : 
IRFPE40 AS17461 NTC10D11 100FC FA5613 2D150 B1370 2SK38
Product Description
Full Text Search
 

To Download TN1180 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  TN1180 technical note how to interpret pressure and temperature readings in pressure sensors by tom bocchino introduction the purpose of this technical note is to provide a review of two's complement notation for ease of design in pressure sensors and to guide the user in the interpretation of pressure and temperature values in the device registers. mems pressure sensors measure absolute pressure ( p ) and temperature ( t ) and store the values in two's complement registers which can be read via the i 2 c or spi host interface. the pressure sensor stores pressure as a 24 - bit word. both values are stored as two's complement integers a s illustrated below. figure 1 : pressure sensor analog -to - digital data flow may 2014 docid026298 rev 1 1 / 9 www.st.com l o w n o i s e a n a l o g f r o n t e n d ( a f e ) a n a l o g t o d i g i t a l c o n v e r s i o n ( a d c ) d i g i t a l c o n t r o l s i g n a l p r o c e s s i n g ( d s p ) & r e g i s t e r b a n k p t i 2 c s p i a n a l o g d o m a i n d i g i t a l d o m a i n p r e s s u r e o u t _ x l ( l s b ) 2 8 h p r e s s u r e o u t _ l ( m i d d l e ) 2 9 h p r e s s u r e o u t _ h ( m s b ) 2 a h b y t e d e s c r i p t i o n a d d r ( h ) t e m p e r a t u r e o u t _ l ( l s b ) 2 b h t e m p e r a t u r e o u t _ h ( m s b ) 2 c h 2 4 - b i t p r e s s u r e c o u n t t w o s c o m p l e m e n t v a l u e 1 6 - b i t t e m p e r a t u r e c o u n t t w o s c o m p l e m e n t v a l u e s e n s o r s a n d b i a s
why we use two's complement TN1180 1 why we use two's complement measuring analog values and storing the data in a digital domain creates an interesting dilemma. how do we represent negative analog values in a digital system? how do we handle the number zero? a computing system uses two's complement to simplify the processing logic required to handle negative numbers and subtractions. a circuit designed for addition can handle negative operands by using two?s complement. this minimizes the need fo r additional circuitry capable of subtraction or additional switching circuitry based on the sign. most modern computers, mcu?s, and dsp?s use two?s complement notation. if a register is defined as two?s complement, typically the most significant bit (msb ) of the most significant byte (msb) indicates the sign as shown in the figure below. if the msb of the register is 1, the number is negative and we use two?s complement. if the bit is 0, the integer is positive and no translation is necessary. figure 2 : sign bit indicates whether a value is positive or negative 2 / 9 docid026298 rev 1 0 = p o s 1 = n e g p r e s s u r e m a g n i t u d e b i t 1 5 b i t 1 4 b i t 1 3 b i t 1 2 b i t 1 1 b i t 1 0 b i t 9 b i t 8 b i t 7 b i t 6 b i t 5 b i t 4 b i t 3 b i t 2 b i t 1 b i t 0 p r e s s o u t _ h ( 0 x 2 a ) p r e s s o u t _ l ( 0 x 2 9 ) p r e s s o u t _ x l ( 0 x 2 8 ) b i t 2 3 b i t 2 2 b i t 2 1 b i t 2 0 b i t 1 9 b i t 1 8 b i t 1 7 b i t 1 6 s i g n
TN1180 how to obtain pressure values in mbar 2 how to obtain pressure values in mbar the pressure sensor stores the pressure value in raw counts in 3 registers: pressout_h, pressout_l, and pressout_xl. the most significant bit of the pressout_h register indicates the polarity. if the sign bit is zero, then the value is positive and the pressure in mbar is determined by dividing the decimal value b y the scaling factor of 4096. a sign bit of 1 indicates a negative value, so we first take the two?s complement of the complete word and then divide by 4096. keep in mind that the sign bit determines whether we should perform the two?s complement operatio n or not. the 3 bytes are concatenated to form a 24 - bit word and the complete word is represented in two?s complement (not the single bytes). when reading the pressure value, it is important to note the byte ordering. this is especially important in auto - increment mode when the address is incremented automatically. the designer should assemble the proper 24 - bit endian format (pressure count = 2ah & 29h & 28h). the device may be configured to report a delta pressure by using the auto - zero feature in ctrl_r eg2 (0x21). when using the auto - zero feature, the pressout() registers could contain a negative value which is the sum difference between the current pressure and the reference pressure. negative values can also occur when a device is defective. hence it c an be used for self - test during a boot - up operation and when the auto - zero feature is not used. an example of a pressure calculation when the sign bit is 0 is shown in the following figure. figure 3 : pressure example 1: sign bit is 0, this is a positive value p r e s s u r e c o u n t s = 2 a h & 2 9 h & 2 8 h = 3 f f 5 8 d h = 4 1 9 1 6 2 9 ( d e c ) p r e s s u r e m i l l i b a r = = = 1 0 2 3 . 3 m b a r 4 0 9 6 c o u n t s / m b a r 4 1 9 1 6 2 9 c o u n t s 3 f f 5 8 d 1 0 0 0 1 1 0 1 b i t 1 5 b i t 1 4 b i t 1 3 b i t 1 2 b i t 1 1 b i t 1 0 b i t 9 b i t 8 b i t 7 b i t 6 b i t 5 b i t 4 b i t 3 b i t 2 b i t 1 b i t 0 p r e s s o u t _ h ( 0 x 2 a ) 1 1 1 1 0 1 0 1 p r e s s o u t _ l ( 0 x 2 9 ) p r e s s o u t _ x l ( 0 x 2 8 ) 1 1 1 1 1 1 b i t 2 3 b i t 2 2 b i t 2 1 b i t 2 0 b i t 1 9 b i t 1 8 b i t 1 7 b i t 1 6 0 0 s c a l i n g f a c t o r # c o u n t s docid026298 rev 1 3 / 9
how to obtain pressure values in mbar TN1180 in some applications the device may be configured to report a differential pressure value in the pressout() registers by using the auto - zero feature. in this case the pressout() registers could contain a negative value as ill ustrated in the second example of a pressure calculation shown below. to obtain the pressure in mbar we first take the two?s complement of the complete word and then divide by 4096. figure 4 : pressure example 2: negative number, two's complement 1 1 1 1 0 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 1 0 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 1 + 1 ; i n v e r t ; a d d 1 ; n e e d t o t a k e t h e t w o ' s c o m p l e m e n t 0 0 0 0 1 1 0 1 1 1 1 0 0 0 0 1 0 1 0 1 1 1 0 0 = - 0 d e 1 5 c h = - 9 0 9 6 6 0 ( d e c ) p r e s s u r e i n m i l l i b a r = = - 2 2 2 . 0 8 m b a r 4 0 9 6 c o u n t s / m b a r - 9 0 9 6 6 0 c o u n t s f 2 1 e a 4 1 0 1 0 0 1 0 0 b i t 1 5 b i t 1 4 b i t 1 3 b i t 1 2 b i t 1 1 b i t 1 0 b i t 9 b i t 8 b i t 7 b i t 6 b i t 5 b i t 4 b i t 3 b i t 2 b i t 1 b i t 0 p r e s s o u t _ h ( 0 x 2 a ) 0 0 0 1 1 1 1 0 p r e s s o u t _ l ( 0 x 2 9 ) p r e s s o u t _ x l ( 0 x 2 8 ) 1 1 0 0 1 0 b i t 2 3 b i t 2 2 b i t 2 1 b i t 2 0 b i t 1 9 b i t 1 8 b i t 1 7 b i t 1 6 1 1 4 9 docid026298 rev 1
TN1180 how to obtain temperature values in c 3 how to obtain temperature values in c the lps331ap also contains a temperature sensor which is used for compensation of the pressure sensor. the temperatu re data is also available for outside applications. the temperature raw count is stored in registers temp_out_h (2ch) and temp_out_l (2bh). the temperature in c can be determined by calculating the two?s complement, if necessary, and perform the scaling. an example of a temperature calculation when the sign bit is 0 is shown below. figure 5 : temperature example 1: sign bit is 0, this is a positive value likewise, a negative value is indicated when the msb in the temperature word is equal to 1. to obtain the temperature, we first take the two?s complement of the complete word and then perform the scaling and offset operation. an example of a temperature calculation when the sign bit is 1 is shown below. figure 6 : temperature example 2: sign bit is 1, two's complement as shown in the figure above, a negative value in the raw count register does not always result in a negative a temperature value in degrees celsius. this is because the offset and scaling fac tor must be applied to determine the final value in c units. t e m p e r a t u r e c o u n t s = 2 c h & 2 b h = 6 b d 0 h = 2 7 6 0 0 ( d e c ) 6 b d 0 b i t 1 5 b i t 1 4 b i t 1 3 b i t 1 2 b i t 1 1 b i t 1 0 b i t 9 b i t 8 t e m p _ o u t _ h ( 0 x 2 c ) 1 1 0 1 0 0 0 0 t e m p _ o u t _ l ( 0 x 2 b ) 1 0 1 0 1 1 b i t 7 b i t 6 b i t 5 b i t 4 b i t 3 b i t 2 b i t 1 b i t 0 0 1 t e m p e r a t u r e i n c = o f f s e t + = 4 2 . 5 + = 1 0 0 c s c a l e # c o u n t s 4 8 0 c o u n t s / c 2 7 6 0 0 c o u n t s 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 + 1 ; i n v e r t ; a d d 1 ; n e e d t o t a k e t h e 2 ' s c o m p l e m e n t 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 0 = - 1 f 8 4 h = - 8 0 6 8 ( d e c ) t e m p e r a t u r e i n c = o f f s e t + = 4 2 . 5 + = + 2 5 . 7 c s c a l e # c o u n t s e 0 7 c b i t 1 5 b i t 1 4 b i t 1 3 b i t 1 2 b i t 1 1 b i t 1 0 b i t 9 b i t 8 t e m p _ o u t _ h ( 0 x 2 c ) 0 1 1 1 1 1 0 0 t e m p _ o u t _ l ( 0 x 2 b ) 1 0 0 0 0 0 b i t 7 b i t 6 b i t 5 b i t 4 b i t 3 b i t 2 b i t 1 b i t 0 1 1 4 8 0 c o u n t s / c - 8 0 6 8 c o u n t s docid026298 rev 1 5 / 9
how to obtain temperature values in c TN1180 when reading the temperature values it is also important to note the byte ordering. this is especially true in auto - increment mode in which case address 2bh is read first, followed by address 2 ch. the designer should assemble the proper 16 - bit endian format (temperature count = 2ch & 2bh). the following registers in the device are two?s complement. all other registers in the device are either unsigned or bitwise representations (not negative). table 1: pressure sensor two's complement registers function bytes description press_out() 2ah & 29h & 28h 24- bit absolute pressure data or this contains the difference in pressure between ref_p() and press_out() when auto - zero mode is used temp_out() 2bh & 2ch 16- bit temperature data ref_p() 0ah & 09h & 08h 24- bit absolute pressure in auto - zero mode 6 / 9 docid026298 rev 1
TN1180 support material 4 support material table 2: related design support material document type part number title datasheet/ data brief lps331ap mems pressure sensor: 260 - 1260 mbar absolute digital output barometer lps25h mems pressure sensor: 260 - 1260 mbar absolute digital output barometer evaluation board steval - mki109v2 emotion: st mems adapter motherboard based on stm32. compatible with all st mems adapters based on stm32f103. steval - mki120v1 lps331ap adapter board for standard dil24 socket steval - mki142v1 lps25h adapter board for standard dil24 socket user manual um0412 getting started with dfuse usb device firmware upgrade stmicroelectronics extension um0979 steval - mki109v1 and steval - mki109v2 - emotion motherboards for mems adapter boards um1049 unico graphical user in terface (gui) um1064 software guide for unico lite application note an4159 hardware and software guidelines for use of the lps331ap an4450 hardware and software guidelines for use of the lps25h pressure sensor docid026298 rev 1 7 / 9
revision history TN1180 5 revision history table 3: document revision history date revision changes 27- may - 2014 1 initial release. 8 / 9 docid026298 rev 1
TN1180 please read carefully information in this document is provided solely in connection with st products. stmicroelectronics nv and its subsidiaries ("st") reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. all st products are sold pursuant to st?s terms and conditions of sale. purchasers are solely responsible for the choice, selection and use of the st products and services described herein, and st assumes no liability whatsoever relating to the choice, selection or use of the st products and services described herein. no lic ense, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. if any part of this document refers to any third party products or services it shall not be deemed a license grant by st for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. unless ot herwise set forth in st?s terms and conditions of sale st disclaims any express or implied warranty with respect to the use and/or sale of st products including without limitation implied warranties of merchantability, fitness for a particular purpose (and their equivalents under the laws of any jurisdiction), or infringement of any patent, copyright or other intellectual property right. st products are not designed or authorized for use in: (a) safety critical applications such as life supporting, active implanted devices or systems with product functional safety requirements; (b) aeronautic applications; (c) automotive applications or environments, and/or (d) aerospace applications or environments. where st products are not designed for such use, the purc haser shall use products at purchaser?s sole risk, even if st has been informed in writing of such usage, unless a product is expressly designated by st as being intended for "automotive, automotive safety or medical" industry domains according to st produ ct design specifications. products formally escc, qml or jan qualified are deemed suitable for use in aerospace by the corresponding governmental agency. resale of st products with provisions different from the statements and/or technical features set for th in this document shall immediately void any warranty granted by st for the st product or service described herein and shall not create or extend in any manner whatsoever, any liability of st. st and the st logo are trademarks or registered trademarks of st in various countries. information in this document supersedes and replaces all information previously supplied. the st logo is a registered trademark of stmicroelectronics. all other name s are the property of their respective owners. ? 2014 stmicroelectronics - all rights reserved stmicroelectronics group of companies australia - belgium - brazil - canada - china - czech republic - finland - france - germany - hong kong - india - isr ael - italy - japan - malaysia - malta - morocco - philippines - singapore - spain - sweden - switzerland - united kingdom - united states of america www.st.com docid026298 rev 1 9 / 9


▲Up To Search▲   

 
Price & Availability of TN1180

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X